class Cat:
    def __init__(self, name):
        self.name = name

    @classmethod
    # 类方法
    def speak(cls):
        print('shout---------')

    # 实例方法
    def miao(self):
        print("miao~~~~~~~~~~~")

    @staticmethod
    # 静态方法可以通过类或对象访问
    # 静态方法
    def meow():
        print("我是静态方法")


cat = Cat("小白")
print(cat.name)
cat.miao()
# 实例属性不能通过类名调用
# AttributeError: type object 'Cat' has no attribute 'name'
# print(Cat.name)

# Cat.miao()
Cat.speak()


# 私有方法：方法的前面加上双下划线__
class Person:
    __name = "Kobe"

    def getName(self):
        return self.__name


person = Person()
print(person.getName())
